// types/transaction.ts
export interface BankTransaction {
  id: string
  transactionId: string
  payerName: string
  payerAccount?: string
  amount: number
  transactionDate: string
  transactionTime: string
  balance?: number
  remark?: string
  bankName?: string
  dataSource: 'file_import' | 'plugin_capture' | 'api_sync'
  importBatch?: string
  isFiltered: boolean
  filterReason?: string
  matchStatus: 'matched' | 'pending' | 'unmatched'
  matchedOrder?: any
  isDuplicate: boolean
  createdAt: string
  updatedAt: string
}

export interface TransactionQueryParams {
  page: number
  limit: number
  transactionStatus?: string
  payerName?: string
  transactionDateRange?: string[]
  minAmount?: number
  maxAmount?: number
  dataSource?: string
  bankName?: string
  transactionType?: string
  importBatch?: string
  hasRemark?: boolean
  showDuplicates?: boolean
  sortField?: string
  sortOrder?: 'asc' | 'desc'
}

export interface TransactionStats {
  totalTransactions: number
  unmatchedTransactions: number
  matchedTransactions: number
  filteredTransactions: number
  todayTransactions: number
  monthlyAmount: number
  autoMatchRate: number
  dataQualityScore: number
  todayTrend: number
  amountTrend: number
  matchTrend: number
  qualityTrend: number
}

export interface FilterRule {
  id: string
  name: string
  condition: string
  action: 'filter' | 'highlight' | 'alert'
  enabled: boolean
  priority: number
}

export interface SmartSuggestion {
  id: string
  type: 'filter' | 'match' | 'review' | 'duplicate'
  description: string
  transactions: string[]
  confidence: number
  action: () => void
}